
$(function() {
	
	$('#date').datepicker(_date1_option);
	
	var options = {
			editable: true,
		    enableAddRow: true,
		    enableCellNavigation: true,
		    asyncEditorLoading: false,
		    rowHeight: 30
		};
	
	var grid = new Slick.Grid($("#myGrid"), data, columns, options);
	
	grid.onAddNewRow.subscribe(function (e, args) {
		
        var item = {ok: true};
        item.date = current_date();
    	
        $.extend(item, args.item);
        data.push(item);
        grid.invalidateRows([data.length - 1]);
        grid.updateRowCount();
        grid.render();
    });
	
	grid.onCellChange.subscribe(function(e, args) {
		item = args.item;
		currentCell = args.cell;
		currentRow = args.row;
    	
    	grid.updateRow(currentRow);
    	grid.updateRowCount();
        grid.render();
    });
});
